package com.cln.salesTaxes;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Taxes extends Tax {
	private List taxes = new ArrayList();
	public Taxes(BigDecimal taxRate) {
		super(taxRate);
	}
	public Taxes() {
	}
	public BigDecimal caculateTaxes(BigDecimal price) {
		Iterator it = taxes.iterator();
		BigDecimal totalDuty = new BigDecimal("0");
		while (it.hasNext()) {
			ITax tax = (ITax) it.next();
			totalDuty=totalDuty.add(tax.caculateTaxes(price));
		}
		return totalDuty;
	}
	public void addTax(ITax tax) {
		this.taxes.add(tax);
	}
}
